package com.ph.seata.business.controller;

import com.ph.seata.business.dto.BusinessDTO;
import com.ph.seata.business.service.BusinessService;
import com.ph.web.common.response.WrapperResponse;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/business/")
@Slf4j
@RequiredArgsConstructor
public class BusinessController {

    private final BusinessService businessService;

    @PostMapping(value = "/buy")
    public WrapperResponse<Object> handleBusiness(@RequestBody BusinessDTO businessDTO) throws Exception{
        log.info("请求参数：{}",businessDTO.toString());
        return businessService.handleBusiness(businessDTO);
    }


}
